<template>
  <div>
    <div class="title">签到设置</div>
    <el-form :model="form" label-width="120px">
      <el-form-item label="第1天签到：">
        <el-input size="small" v-model="form.dayOne"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第2天签到：">
        <el-input size="small" v-model="form.dayTwo"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第3天签到：">
        <el-input size="small" v-model="form.dayThree"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第4天签到：">
        <el-input size="small" v-model="form.dayFour"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第5天签到：">
        <el-input size="small" v-model="form.dayFive"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第6天签到：">
        <el-input size="small" v-model="form.daySix"></el-input> 钻石
      </el-form-item>
      <el-form-item label="第7天签到：">
        <el-input size="small" v-model="form.daySeven"></el-input> 钻石
      </el-form-item>
      <el-form-item size="large">
        <el-button size="small" @click="$router.go(-1)">返回</el-button>
        <el-button type="primary" size="small" @click="updateSigninSetup">保存</el-button>
      </el-form-item>

    </el-form>
  </div>
</template>

<script>
  import apis from "../../../apis/modules/signinSetting"
  export default {
    data() {
      return {
        form: {
          dayOne: 1,
          dayTwo: 2,
          dayThree: 3,
          dayFour: 4,
          dayFive: 5,
          daySix: 6,
          daySeven: 7
        },
      };
    },
    methods: {
      //获取签到设置
      getSigninSetup(){
        apis.getSigninSetup().then((res) => {
          if (res.code == 200) {
            this.form = res.data;
          }
        });
      },
      //修改签到设置
      updateSigninSetup(){
        apis.updateSigninSetup(this.form).then((res) => {
          if (res.code == 200) {
            this.$message.success('保存成功');
          }
        });
      }
    },
    mounted(){
      this.getSigninSetup();
    }
  };
</script>
<style lang="scss" scoped>
  .el-input {
    width: 80px;
  }
</style>